/*
 * AmplScriptWriter.h
 *
 *  Created on: 27 Jun 2011
 *      Author: s0965328
 */

#ifndef AMPLSCRIPTWRITER_H_
#define AMPLSCRIPTWRITER_H_

#include "AmplScript.h"
#include <vector>
#include <sstream>
#include <string>

using namespace std;

class AmplScriptWriter {
public:
	AmplScriptWriter(string model);

	virtual ~AmplScriptWriter();

	//split each script file into GlobalVariable:num_parallel script files.
	void split();

	//writing the parallel part which depends on AmplScript.index
	void writeParallelPartOfScript(string line);

	//just write on each of the script files
	//void writeScript(string line);
	void writeScript(ostringstream& oss);

	void closeAll();

	vector<AmplScript*> *scriptList;
	string modelname;
	int script_num;

private:
	void setUpRootScript();


};

#endif /* AMPLSCRIPTWRITER_H_ */
